
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>初始结构 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../architecture/" />
    
    
    <link rel="prev" href="Angular-cli.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    Angular-cli
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="Angular-cli.html">
            
                <a href="Angular-cli.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="restMenu.html">
            
                <a href="restMenu.html">
            
                    
                    初始结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../architecture/">
            
                <a href="../architecture/">
            
                    
                    架构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../architecture/mo-kuai.html">
            
                <a href="../architecture/mo-kuai.html">
            
                    
                    模块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../architecture/component.html">
            
                <a href="../architecture/component.html">
            
                    
                    组件简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../architecture/Service.html">
            
                <a href="../architecture/Service.html">
            
                    
                    服务与依赖注入
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../comAndtem/">
            
                <a href="../comAndtem/">
            
                    
                    组件与模板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../comAndtem/zu-jian-yu-mo-ban.html">
            
                <a href="../comAndtem/zu-jian-yu-mo-ban.html">
            
                    
                    数据显示与模板语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../comAndtem/cycle.html">
            
                <a href="../comAndtem/cycle.html">
            
                    
                    生命周期钩子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../comAndtem/component.html">
            
                <a href="../comAndtem/component.html">
            
                    
                    组件交互
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../comAndtem/style.html">
            
                <a href="../comAndtem/style.html">
            
                    
                    组件样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../comAndtem/dynamic.html">
            
                <a href="../comAndtem/dynamic.html">
            
                    
                    动态组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../comAndtem/directive.html">
            
                <a href="../comAndtem/directive.html">
            
                    
                    属性指令与结构指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../comAndtem/pipeAndAnimit.html">
            
                <a href="../comAndtem/pipeAndAnimit.html">
            
                    
                    管道与动画
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../router/">
            
                <a href="../router/">
            
                    
                    路由与导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../form/">
            
                <a href="../form/">
            
                    
                    表单
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../http/">
            
                <a href="../http/">
            
                    
                    请求http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../project/">
            
                <a href="../project/">
            
                    
                    项目解析:结构目录
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >初始结构</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x5DE5;&#x7A0B;&#x7ED3;&#x6784;&#x56FE;&#x5982;&#x4E0B;&#xFF1A;
    <img src="../assets/3020614-f8532e8060b7aab9.png" alt=""></p>
<pre><code>e2e &#x7AEF;&#x5230;&#x7AEF;&#x7684;&#x6D4B;&#x8BD5;&#x76EE;&#x5F55; &#x7528;&#x6765;&#x505A;&#x81EA;&#x52A8;&#x6D4B;&#x8BD5;&#x7684;

node_modules &#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;&#x5305;&#x5B58;&#x653E;&#x76EE;&#x5F55;

src &#x5E94;&#x7528;&#x6E90;&#x4EE3;&#x7801;&#x76EE;&#x5F55;

app&#x76EE;&#x5F55;               &#x5305;&#x542B;&#x5E94;&#x7528;&#x7684;&#x7EC4;&#x4EF6;&#x548C;&#x6A21;&#x5757;&#xFF0C;&#x6211;&#x4EEC;&#x8981;&#x5199;&#x7684;&#x4EE3;&#x7801;&#x90FD;&#x5728;&#x8FD9;&#x4E2A;&#x76EE;&#x5F55;

app.component.ts&#x2014; &#x7EC4;&#x4EF6;&#x7684;&#x7C7B;&#x4EE3;&#x7801;&#xFF0C;&#x8FD9;&#x662F;&#x7528; TypeScript &#x5199;&#x7684;&#x3002;

app.component.html&#x2014; &#x7EC4;&#x4EF6;&#x7684;&#x6A21;&#x677F;&#xFF0C;&#x8FD9;&#x662F;&#x7528; HTML &#x5199;&#x7684;&#x3002;

app.component.css&#x2014; &#x7EC4;&#x4EF6;&#x7684;&#x79C1;&#x6709; CSS &#x6837;&#x5F0F;&#x3002;

app.component.spec.ts&#x2014; &#x7EC4;&#x4EF6;&#x7684;&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x3002;


assets&#x76EE;&#x5F55;            &#x8D44;&#x6E90;&#x76EE;&#x5F55;&#xFF0C;&#x5B58;&#x50A8;&#x9759;&#x6001;&#x8D44;&#x6E90;&#x7684;
&#x6BD4;&#x5982;&#x56FE;&#x7247;

environments&#x76EE;&#x5F55;      &#x73AF;&#x5883;&#x914D;&#x7F6E;&#x3002;Angular&#x662F;&#x652F;&#x6301;&#x591A;&#x73AF;&#x5883;&#x5F00;&#x53D1;&#x7684;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5728;&#x4E0D;&#x540C;&#x7684;&#x73AF;&#x5883;&#x4E0B;&#xFF08;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#xFF0C;&#x6D4B;&#x8BD5;&#x73AF;&#x5883;&#xFF0C;&#x751F;&#x4EA7;&#x73AF;&#x5883;&#xFF09;&#x5171;&#x7528;&#x4E00;&#x5957;&#x4EE3;&#x7801;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x6765;&#x914D;&#x7F6E;&#x73AF;&#x5883;&#x7684;

index.html          &#x6574;&#x4E2A;&#x5E94;&#x7528;&#x7684;&#x6839;html&#xFF0C;&#x7A0B;&#x5E8F;&#x542F;&#x52A8;&#x5C31;&#x662F;&#x8BBF;&#x95EE;&#x8FD9;&#x4E2A;&#x9875;&#x9762;

main.ts             &#x6574;&#x4E2A;&#x9879;&#x76EE;&#x7684;&#x5165;&#x53E3;&#x70B9;&#xFF0C;Angular&#x901A;&#x8FC7;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;&#x6765;&#x542F;&#x52A8;&#x9879;&#x76EE;

polyfills.ts        &#x4E3B;&#x8981;&#x662F;&#x7528;&#x6765;&#x5BFC;&#x5165;&#x4E00;&#x4E9B;&#x5FC5;&#x8981;&#x5E93;&#xFF0C;&#x4E3A;&#x4E86;&#x8BA9;Angular&#x80FD;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x5728;&#x8001;&#x7248;&#x672C;&#x4E0B;
styles.css          &#x4E3B;&#x8981;&#x662F;&#x653E;&#x4E00;&#x4E9B;&#x5168;&#x5C40;&#x7684;&#x6837;&#x5F0F;

tsconfig.app.json   TypeScript&#x7F16;&#x8BD1;&#x5668;&#x7684;&#x914D;&#x7F6E;,&#x6DFB;&#x52A0;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;&#x7684;&#x65F6;&#x5019;&#x4F1A;&#x4FEE;&#x6539;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;

tsconfig.spec.json  &#x4E0D;&#x7528;&#x7BA1;

test.ts             &#x4E5F;&#x662F;&#x81EA;&#x52A8;&#x5316;&#x6D4B;&#x8BD5;&#x7528;&#x7684;

typings.d.ts        &#x4E0D;&#x7528;&#x7BA1;



angular-cli.json Angular&#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x3002;&#x540E;&#x671F;&#x53EF;&#x80FD;&#x4F1A;&#x53BB;&#x4FEE;&#x6539;&#x5B83;&#xFF0C;&#x5F15;&#x4E00;&#x4E9B;&#x5176;&#x4ED6;&#x7684;&#x7B2C;&#x4E09;&#x65B9;&#x7684;&#x5305; &#x6BD4;&#x5982;jquery&#x7B49;

karma.conf.js karma&#x662F;&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x7684;&#x6267;&#x884C;&#x5668;&#xFF0C;karma.conf.js&#x662F;karma&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;

package.json &#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x6807;&#x51C6;&#x7684;npm&#x5DE5;&#x5177;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;&#x91CC;&#x9762;&#x5217;&#x51FA;&#x4E86;&#x8BE5;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x6240;&#x4F7F;&#x7528;&#x7684;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;&#x5305;&#x3002;&#x5B9E;&#x9645;&#x4E0A;&#x6211;&#x4EEC;&#x5728;&#x65B0;&#x5EFA;&#x9879;&#x76EE;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x7B49;&#x4E86;&#x534A;&#x5929;&#x5C31;&#x662F;&#x5728;&#x4E0B;&#x8F7D;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;&#x5305;&#x3002;&#x4E0B;&#x8F7D;&#x5B8C;&#x6210;&#x540E;&#x4F1A;&#x653E;&#x5728;node_modules&#x8FD9;&#x4E2A;&#x76EE;&#x5F55;&#x4E2D;&#xFF0C;&#x540E;&#x671F;&#x6211;&#x4EEC;&#x53EF;&#x80FD;&#x4F1A;&#x4FEE;&#x6539;&#x8FD9;&#x4E2A;&#x6587;&#x4EF6;&#x3002;

protractor.conf.js &#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x505A;&#x81EA;&#x52A8;&#x5316;&#x6D4B;&#x8BD5;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;

README.md &#x8BF4;&#x660E;&#x6587;&#x4EF6;

tslint.json &#x662F;tslint&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x7528;&#x6765;&#x5B9A;&#x4E49;TypeScript&#x4EE3;&#x7801;&#x8D28;&#x91CF;&#x68C0;&#x67E5;&#x7684;&#x89C4;&#x5219;
</code></pre><h3 id="&#x5E38;&#x7528;&#x6307;&#x4EE4;">&#x5E38;&#x7528;&#x6307;&#x4EE4;</h3>
<p>&#x521B;&#x5EFA;module&#xFF0C;component&#xFF0C;service&#xFF0C;class</p>
<p><img src="../assets/3020614-243cbfb9a17f3043.png" alt=""></p>
<p></p><p>&#x5217; &#xFF1A;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;home&#x7684;module&#xFF1B;</p>
 <code>ng g component home</code><p></p>
<p><img src="../assets/3020614-0deaed202b49d980.png" alt=""></p>
<p>app&#x4E0B;&#x9762;&#x591A;&#x4E86;&#x4E00;&#x4E2A;home&#x7684;component&#xFF0C;&#x5B83;&#x5E94;&#x6709;&#x7684;css&#xFF0C;html&#xFF0C;<em>.spec.ts(&#x6D4B;&#x8BD5;&#x4EE3;&#x7801;)&#xFF0C;ts&#x90FD;&#x751F;&#x6210;&#x4E86;&#xFF1B;css&#xFF0C;html&#xFF0C;ts&#xFF0C;</em>.spec.ts&#x90FD;&#x653E;&#x5728;&#x8FD9;&#x4E0B;&#x9762;,&#x65B9;&#x4FBF;&#x7EC4;&#x4EF6;&#x5316;&#x53EF;&#x4EE5;&#x91CD;&#x590D;&#x4F7F;&#x7528;&#xFF0C;&#x63D0;&#x9AD8;&#x6548;&#x7387;&#xFF0C;&#x5E9E;&#x5927;&#x7684;&#x5DE5;&#x7A0B;&#x4EE3;&#x7801;&#x4E2D;&#x53EF;&#x4EE5;&#x63D0;&#x9AD8;&#x53EF;&#x7EF4;&#x62A4;&#x6027;&#xFF0C;&#x9605;&#x8BFB;&#x6027;&#xFF0C;&#x65B9;&#x4FBF;&#x6D4B;&#x8BD5;&#x7B49;&#x7B49;</p>
<p>&#x518D;&#x8BD5;&#x7740;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;angular&#x7684;&#x6A21;&#x5757;
<code>ng g module about</code></p>
<p><img src="../assets/3020614-41953f0517ab924d.png" alt=""></p>
<p>&#x6A21;&#x5757;&#x6BD4;component&#x591A;&#x4E86;&#x4E00;&#x4E2A;module.ts&#x6587;&#x4EF6;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Angular-cli.html" class="navigation navigation-prev " aria-label="Previous page: 安装">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../architecture/" class="navigation navigation-next " aria-label="Next page: 架构">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"初始结构","level":"1.2.2","depth":2,"next":{"title":"架构","level":"1.3","depth":1,"path":"architecture/README.md","ref":"architecture/README.md","articles":[{"title":"模块简介","level":"1.3.1","depth":2,"path":"architecture/mo-kuai.md","ref":"architecture/mo-kuai.md","articles":[]},{"title":"组件简介","level":"1.3.2","depth":2,"path":"architecture/component.md","ref":"architecture/component.md","articles":[]},{"title":"服务与依赖注入","level":"1.3.3","depth":2,"path":"architecture/Service.md","ref":"architecture/Service.md","articles":[]}]},"previous":{"title":"安装","level":"1.2.1","depth":2,"path":"Angular-cli/Angular-cli.md","ref":"Angular-cli/Angular-cli.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["fontsettings","sharing","lunr","search","highlight","livereload"],"pluginsConfig":{"fontsettings":{"family":"sans","size":2,"theme":"white"},"sharing":{"all":["facebook","google","twitter","weibo","instapaper"],"facebook":true,"google":false,"instapaper":false,"twitter":true,"vk":false,"weibo":false},"lunr":{"ignoreSpecialCharacters":false,"maxIndexSize":1000000},"search":{},"highlight":{},"livereload":{},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Angular-cli/restMenu.md","mtime":"2018-06-12T06:37:34.630Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-06-29T06:02:19.129Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    

    </body>
</html>

